package com.example.hospitaldemo.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.hospitaldemo.entity.CheckInRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

/**
 * <p>
 * 入院记录表 Mapper 接口
 * </p>
 *
 * @author 张三
 * @since 2024-12-16
 */
public interface CheckInRecordMapper extends BaseMapper<CheckInRecord> {
    /**
     * 出院功能查询所有的数据
     */
    @Select("select * from check_in_record ${ew.customSqlSegment}")
    @Results({
            @Result(column = "patient_id",property = "patientId"),
            @Result(column = "patient_id",property = "patient",
                    one = @One(select = "com.example.hospitaldemo.mapper.PatientMapper.selectById")),
            @Result(column = "zhiliaoshi_id",property = "zhiliaoshiId"),
            @Result(column = "zhiliaoshi_id",property = "zhiliaoshi",
                    one = @One(select = "com.example.hospitaldemo.mapper.ZhiliaoshiMapper.selectById")),

    })
   CheckInRecord getByZhiliaoshiId(@Param("ew") QueryWrapper<CheckInRecord> wrapper);
}
